package net.sashag.nadlandroid;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.springframework.web.client.RestTemplate;

import com.googlecode.androidannotations.annotations.rest.Get;
import com.googlecode.androidannotations.annotations.rest.Rest;

class GoogleGeocodingResult {
	@JsonIgnore public String[] types;
	public String formatted_address;
	@JsonIgnore public String[] address_components;
	@JsonIgnore public String geometry;
}

class GoogleGeocodingReply {
	public String status;
	public GoogleGeocodingResult[] results;
}

@Rest("http://maps.googleapis.com/maps/api/geocode")
public interface GoogleGeocodingService {
	@Get("/json?latlng={lat},{lon}&sensor={sensor}")
	GoogleGeocodingReply geocodeLocation(double lat, double lon, boolean sensor);
	
	//For internal purposes, this isn't part of the Google API
	RestTemplate getRestTemplate();
	void setRestTemplate(RestTemplate restTemplate);
}
